Loss function
During training or testing, a mathematical function that calculates the loss on a batch of examples. A loss function returns a lower loss for models that makes good predictions than for models that make bad predictions.1
The goal of training is typically to minimize the loss that a loss function returns.1
Many different kinds of loss functions exist. Pick the appropriate loss function for the kind of model you are building. For example:1
- L2 loss (or MSE) is the loss function for linear regression.
- Log loss is the loss function for logistic regression.